import { createRouter, createWebHistory } from 'vue-router'
import AddressView from "@/views/address/AddressView.vue";
import CreateAddressView from "@/views/address/CreateAddressView.vue";
import CartView from "@/views/cart/CartView.vue";
import HomeView from "@/views/home/HomeView.vue";
import LayoutView from "@/views/layout/LayoutView.vue";
import MyView from "@/views/my/MyView.vue";
import OrderView from "@/views/order/OrderView.vue";
import OrderConfirmationView from "@/views/order/OrderConfirmationView.vue";
import ShopView from "@/views/shop/ShopView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/home',
      name: 'layout',
      component: LayoutView,
      children:[
        {
          path:'home',
          name:'home',
          component:HomeView
        },
        {
          path:'cart',
          name:'cart',
          component:CartView
        },
        {
          path:'order',
          name:'order',
          component:OrderView
        },
        {
          path:'my',
          name:'my',
          component:MyView
        }
      ]
    },
    {
      path:'/shop',
      name:'shop',
      component:ShopView
    },
    {
      path:'/orderConfirmation',
      name:'orderConfirmation',
      component:OrderConfirmationView
    },
    {
      path:'/address',
      name:'address',
      component:AddressView
    },
    {
      path:'/createAddress',
      name:'createAddress',
      component:CreateAddressView
    }
  ]
})

export default router
